const express = require('express');
const app = express()
const session = require('express-session')
// const app = require('./router/index')
/////////////////////////////
const author = require('./middleware/author')
const router = require('./router/index')
const config = require('./config')
app.use('/static',express.static('./static'))//////////////////////////////////
//////////////////////////////
app.use(express.json())
app.use(express.urlencoded({ extended: true }))

app.use(session(
    config.session
))
app.use(author)
app.use(router)//跳转


app.listen(config.port, () => {
    console.log('启动成功');
})